package com.liachen.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

/**
 * @author EDY
 */

@NoArgsConstructor
@AllArgsConstructor
@Getter
public enum UserType {
    TOTAL("paihang.shtml"),MONTH("yyl.shtml"),WEEK("zyl.shtml"),SUCCESS("xgcg.shtml"),FOLLOW("zzcs.shtml"),GRADE("dw.shtml");
    //,DAILY("ryl.shtml")
    /**
     * 查询地址
     */
    private String url;

    public static UserType getByType(String type) {
        if (StringUtils.isBlank(type)) {
            return TOTAL;
        }
        for (UserType userType : UserType.values()) {
            if (type.equalsIgnoreCase(userType.name())) {
                return userType;
            }
        }
        return TOTAL;
    }
}
